package procilege.impl.eval;

import procilege.compute.ExprEvaluationTraveller;
import procilege.compute.PlaceTypeMetadata;
import procilege.compute.PlaceType;
import procilege.lang.PredicatePrivAvailiability;
import procilege.lang.PrivilegeFormAnalysis;

import com.google.inject.Inject;

@PlaceTypeMetadata(type = PredicatePrivAvailiability.class)
public class PredicatePrivAvailiabilityEvalPlace implements
		PlaceType<ExprEvaluationTraveller> {

	@Inject
	private PrivilegeFormAnalysis pfa;

	public void visit(ExprEvaluationTraveller tr, Object place) {

		PredicatePrivAvailiability expr = (PredicatePrivAvailiability) place;

		Object val = pfa.available(pfa.privform(expr.getPrivExpr()));
		tr.result(val);
	}
}
